package com.sinosoft.rabbit;

import com.sinosoft.listener.AutoConfigListener;
import org.springframework.amqp.rabbit.annotation.EnableRabbit;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * 使用Eureka做服务发现.
 *
 */
@ComponentScan("com.sinosoft")
//组件扫描
@Configuration
//配置控制
@SpringBootApplication
@EnableRabbit
@EnableEurekaClient
public class RabbitServerApplication {

    public static void main(String[] args) {
        //SpringApplication.run(RabbitServerApplication.class, args);
        SpringApplication springApplication = new SpringApplication(RabbitServerApplication.class);
        springApplication.addListeners(new AutoConfigListener());
        springApplication.setWebApplicationType(WebApplicationType.SERVLET);
        springApplication.run(args);

    }
}
